blacklight 8.0.0.beta4 → 8.0.0.beta5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +3 -1
  3. data/VERSION +1 -1
  4. data/app/assets/javascripts/blacklight/blacklight.esm.js +5 -5
  5. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
  6. data/app/assets/javascripts/blacklight/blacklight.js +5 -5
  7. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
  8. data/app/components/blacklight/document_component.rb +26 -19
  9. data/app/components/blacklight/document_metadata_component.html.erb +4 -2
  10. data/app/components/blacklight/document_metadata_component.rb +8 -2
  11. data/app/components/blacklight/metadata_field_layout_component.rb +7 -4
  12. data/app/components/blacklight/metadata_field_plain_text_layout_component.rb +17 -0
  13. data/app/components/blacklight/response/sort_component.rb +1 -1
  14. data/app/components/blacklight/response/spellcheck_component.rb +1 -1
  15. data/app/components/blacklight/response/view_type_button_component.rb +1 -1
  16. data/app/components/blacklight/response/view_type_component.rb +1 -1
  17. data/app/components/blacklight/search_context/server_applied_params_component.html.erb +4 -0
  18. data/app/components/blacklight/search_context/server_applied_params_component.rb +13 -0
  19. data/app/components/blacklight/{search_context_component.html.erb → search_context/server_item_pagination_component.html.erb} +0 -0
  20. data/app/components/blacklight/search_context/server_item_pagination_component.rb +71 -0
  21. data/app/components/blacklight/system/dropdown_component.rb +1 -1
  22. data/app/components/blacklight/system/flash_message_component.rb +1 -1
  23. data/app/components/blacklight/system/modal_component.rb +1 -1
  24. data/app/controllers/concerns/blacklight/bookmarks.rb +1 -1
  25. data/app/controllers/concerns/blacklight/search_context.rb +46 -6
  26. data/app/helpers/blacklight/blacklight_helper_behavior.rb +0 -96
  27. data/app/helpers/blacklight/catalog_helper_behavior.rb +27 -54
  28. data/app/helpers/blacklight/component_helper_behavior.rb +0 -11
  29. data/app/helpers/blacklight/document_helper_behavior.rb +76 -0
  30. data/app/helpers/blacklight/layout_helper_behavior.rb +59 -0
  31. data/app/helpers/blacklight/url_helper_behavior.rb +11 -3
  32. data/app/javascript/blacklight/modal.js +5 -5
  33. data/app/models/record_mailer.rb +19 -15
  34. data/app/presenters/blacklight/document_presenter.rb +13 -11
  35. data/app/presenters/blacklight/index_presenter.rb +1 -1
  36. data/app/presenters/blacklight/rendering/abstract_step.rb +4 -0
  37. data/app/presenters/blacklight/rendering/join.rb +7 -1
  38. data/app/presenters/blacklight/rendering/link_to_facet.rb +1 -1
  39. data/app/presenters/blacklight/rendering/microdata.rb +1 -1
  40. data/app/services/blacklight/search_service.rb +2 -1
  41. data/app/views/catalog/_document.atom.builder +1 -1
  42. data/app/views/catalog/_document.html.erb +2 -7
  43. data/app/views/catalog/_document_list.html.erb +2 -1
  44. data/app/views/catalog/_show_main_content.html.erb +3 -9
  45. data/app/views/catalog/index.html.erb +3 -0
  46. data/app/views/catalog/show.html.erb +1 -6
  47. data/app/views/record_mailer/email_record.text.erb +4 -3
  48. data/app/views/record_mailer/sms_record.text.erb +4 -4
  49. data/config/locales/blacklight.ar.yml +0 -6
  50. data/config/locales/blacklight.ca.yml +0 -6
  51. data/config/locales/blacklight.de.yml +0 -6
  52. data/config/locales/blacklight.en.yml +0 -6
  53. data/config/locales/blacklight.es.yml +0 -6
  54. data/config/locales/blacklight.fr.yml +0 -6
  55. data/config/locales/blacklight.hu.yml +0 -6
  56. data/config/locales/blacklight.it.yml +0 -6
  57. data/config/locales/blacklight.nl.yml +0 -6
  58. data/config/locales/blacklight.pt-BR.yml +0 -6
  59. data/config/locales/blacklight.sq.yml +0 -6
  60. data/config/locales/blacklight.zh.yml +0 -6
  61. data/lib/blacklight/configuration/session_tracking_config.rb +45 -0
  62. data/lib/blacklight/configuration.rb +8 -4
  63. data/lib/blacklight/routes/searchable.rb +1 -0
  64. data/lib/generators/blacklight/templates/solr_document.rb +0 -6
  65. data/package.json +1 -1
  66. data/spec/components/blacklight/document_component_spec.rb +9 -4
  67. data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +29 -0
  68. data/spec/components/blacklight/{search_context_component_spec.rb → search_context/server_item_pagination_component_spec.rb} +15 -4
  69. data/spec/controllers/bookmarks_controller_spec.rb +1 -1
  70. data/spec/controllers/catalog_controller_spec.rb +17 -5
  71. data/spec/features/component_template_override_spec.rb +8 -0
  72. data/spec/features/modal_spec.rb +12 -0
  73. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +1 -1
  74. data/spec/helpers/blacklight_helper_spec.rb +0 -56
  75. data/spec/helpers/catalog_helper_spec.rb +56 -0
  76. data/spec/lib/blacklight/configuration/session_tracking_config_spec.rb +38 -0
  77. data/spec/models/record_mailer_spec.rb +36 -23
  78. data/spec/presenters/blacklight/document_presenter_spec.rb +1 -0
  79. data/spec/presenters/blacklight/field_presenter_spec.rb +2 -2
  80. data/spec/presenters/blacklight/index_presenter_spec.rb +1 -0
  81. data/spec/presenters/blacklight/show_presenter_spec.rb +1 -0
  82. data/spec/presenters/pipeline_spec.rb +13 -2
  83. data/spec/routing/catalog_routing_spec.rb +4 -0
  84. data/spec/test_app_templates/lib/generators/test_app_generator.rb +8 -0
  85. data/spec/views/catalog/_document.html.erb_spec.rb +1 -1
  86. data/spec/views/catalog/_document_list.html.erb_spec.rb +7 -2
  87. metadata +19 -12
  88. data/app/components/blacklight/search_context_component.rb +0 -68
  89. data/app/models/concerns/blacklight/document/email.rb +0 -27
  90. data/app/models/concerns/blacklight/document/sms.rb +0 -25
  91. data/spec/models/blacklight/document/email_spec.rb +0 -57
  92. data/spec/models/blacklight/document/sms_spec.rb +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bdb31dc7213ba281b3b0624c60839931674362f207531615aebc3b3650959c4
4
- data.tar.gz: 361617f4c94ce23944b5562d66bd29e85c536855f1417eaadd9bd019b0c065a2
3
+ metadata.gz: 9e3c3bcd542b381b1d7e4c00c653ad1556d4bd2119e1372a3c8545acef980cff
4
+ data.tar.gz: 285b2f3e0cb5909d696ef91d110b8afcb6e62ca28c0c887cded18df16398c645
5
5
  SHA512:
6
- metadata.gz: 59dcf2e629cc463a759db5ea073568d1cae6e31b1d0cfe15f5ab14b976b154d8cdb5e0e0107055e5bda9ceb66e77edd1006ca04aef1b9324c1e10f8f8b7636f5
7
- data.tar.gz: 58baa5dfcae4ebe4f79846e1c0ac3f3d7a702240ffdad4d99919526f7fd4559af3c75deb58f42fa8191226796406af11ad4687a4231c09c576e5d09ff5c68eae
6
+ metadata.gz: 795eca6d0f26f1e9441d84f1ce7ced56f2f8b459f3ef41a5c34f5c293aab47c43c57e0147b8c57a4051f6be9f1442aea7696c586c4ab41f6b7aa70a0495a5de0
7
+ data.tar.gz: 00efe72d6d5fdeaf914d667cdd6ac2e278e7083ae6dc4cdaaf3db60a3f7df606617f2df2615fbc28840746404a94f072b1ff20df0c82095246e5869fa9b2abf9
data/.rubocop_todo.yml CHANGED
@@ -371,7 +371,9 @@ Rails/HelperInstanceVariable:
371
371
  Exclude:
372
372
  - 'app/helpers/blacklight/blacklight_helper_behavior.rb'
373
373
  - 'app/helpers/blacklight/catalog_helper_behavior.rb'
374
+ - 'app/helpers/blacklight/document_helper_behavior.rb'
374
375
  - 'app/helpers/blacklight/component_helper_behavior.rb'
376
+ - 'app/helpers/blacklight/layout_helper_behavior.rb'
375
377
  - 'app/helpers/blacklight/render_partials_helper_behavior.rb'
376
378
 
377
379
  # Offense count: 2
@@ -384,7 +386,7 @@ Rails/I18nLocaleAssignment:
384
386
  # Offense count: 10
385
387
  Rails/OutputSafety:
386
388
  Exclude:
387
- - 'app/components/blacklight/search_context_component.rb'
389
+ - 'app/components/blacklight/search_context/server_item_pagination_component.rb'
388
390
  - 'app/helpers/blacklight/catalog_helper_behavior.rb'
389
391
  - 'app/helpers/blacklight/configuration_helper_behavior.rb'
390
392
  - 'app/presenters/blacklight/rendering/join.rb'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 8.0.0.beta4
1
+ 8.0.0.beta5
@@ -192,7 +192,7 @@ const ButtonFocus = (() => {
192
192
 
193
193
  <div data-blacklight-modal="container">
194
194
  <div class="modal-header">
195
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
195
+ <button type="button" class="close" data-bl-dismiss="modal" aria-hidden="true">×</button>
196
196
  <h3 class="modal-title">Request Placed</h3>
197
197
  </div>
198
198
 
@@ -203,7 +203,7 @@ const ButtonFocus = (() => {
203
203
 
204
204
 
205
205
  <div class="modal-footer">
206
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
206
+ <button type="button" class="btn btn-secondary" data-bl-dismiss="modal">Close</button>
207
207
  </div>
208
208
  </div>
209
209
 
@@ -247,7 +247,7 @@ const Modal = (() => {
247
247
 
248
248
  const contents = `<div class="modal-header">
249
249
  <div class="modal-title">There was a problem with your request.</div>
250
- <button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close">
250
+ <button type="button" class="blacklight-modal-close btn-close close" data-bl-dismiss="modal" aria-label="Close">
251
251
  <span aria-hidden="true" class="visually-hidden">&times;</span>
252
252
  </button>
253
253
  </div>
@@ -297,9 +297,9 @@ const Modal = (() => {
297
297
  // into one selector with a comma, so if something matches BOTH selectors, it
298
298
  // still only gets the event handler called once.
299
299
  document.addEventListener('click', (e) => {
300
- if (e.target.matches(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))
300
+ if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))
301
301
  modal.modalAjaxLinkClick(e);
302
- else if (e.target.matches('[data-bl-dismiss="modal"]'))
302
+ else if (e.target.closest('[data-bl-dismiss="modal"]'))
303
303
  modal.hide();
304
304
  });
305
305
  };
@@ -1 +1 @@
1
- {"version":3,"file":"blacklight.esm.js","sources":["../../../javascript/blacklight/core.js","../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/index.js"],"sourcesContent":["const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n async clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n const response = await fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n })\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n if (response.ok) {\n const json = await response.json()\n this.updateStateFor(!this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n } else {\n alert('Error')\n }\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n updateStateFor(state) {\n this.checkboxTarget.checked = state\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import Blacklight from './core'\nimport CheckboxSubmit from './checkbox_submit'\n\nconst BookmarkToggle = (() => {\n // change form submit toggle to checkbox\n Blacklight.doBookmarkToggleBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-checkboxsubmit-target=\"checkbox\"]')) {\n const form = e.target.closest('form')\n if (form) new CheckboxSubmit(form).clicked(e);\n }\n });\n };\n Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';\n\n Blacklight.doBookmarkToggleBehavior();\n})()\n\nexport default BookmarkToggle\n","const ButtonFocus = (() => {\n document.addEventListener('click', (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-toggle=\"collapse\"]') || e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n })\n})()\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport Blacklight from './core'\nimport ModalForm from './modalForm'\n\nconst Modal = (() => {\n // We keep all our data in Blacklight.modal object.\n // Create lazily if someone else created first.\n if (Blacklight.modal === undefined) {\n Blacklight.modal = {};\n }\n\n const modal = Blacklight.modal\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-dismiss=\"modal\" data-bs-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n\n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)\n\n modal.show();\n };\n\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.matches(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.matches('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n modal.setupModal()\n})()\n\nexport default Modal\n","import Blacklight from './core'\n\nconst SearchContext = (() => {\n Blacklight.doSearchContextBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-context-href]')) {\n Blacklight.handleSearchContextMethod.call(e.target, e)\n }\n })\n };\n\n Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\n Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n // this is the Rails.handleMethod with a couple adjustments, described inline:\n // first, we're attaching this directly to the event handler, so we can check for meta-keys\n Blacklight.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = Blacklight.csrfToken()\n let csrfParam = Blacklight.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n };\n\n Blacklight.doSearchContextBehavior();\n})()\n\nexport default SearchContext\n","import BookmarkToggle from './bookmark_toggle'\nimport ButtonFocus from './button_focus'\nimport Modal from './modal'\nimport SearchContext from './search_context'\nimport Core from './core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":"AAAA,MAAM,UAAU,GAAG,WAAW;AAC9B,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC;AAC3B,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,SAAS,IAAI,EAAE;AAC3B,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxB,KAAK;AACL;AACA,IAAI,QAAQ,EAAE,WAAW;AACzB,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACz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,SAAS,EAAE,SAAS,CAAC,kBAAkB,EAAC;AACvF,KAAK;AACL;AACA;AACA;AACA,IAAI,WAAW,IAAI,0BAAyB;AAC5C;AACA,IAAI,IAAI,MAAM,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE;AACxD;AACA,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,OAAM;AAC/B,IAAI,IAAI,CAAC,SAAS,GAAG,YAAW;AAChC,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC;AACnC,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AACjD;AACA,IAAI,KAAK,CAAC,cAAc,GAAE;AAC1B,GAAG,CAAC;AACJ;AACA,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;AACvC,CAAC;;AClDD,cAAe;AACf,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,KAAK;AACP,EAAE,aAAa;AACf,QAAEA,UAAI;AACN,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;AACrB;;;;"}
1
+ {"version":3,"file":"blacklight.esm.js","sources":["../../../javascript/blacklight/core.js","../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/index.js"],"sourcesContent":["const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n async clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n const response = await fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n })\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n if (response.ok) {\n const json = await response.json()\n this.updateStateFor(!this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n } else {\n alert('Error')\n }\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n updateStateFor(state) {\n this.checkboxTarget.checked = state\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import Blacklight from './core'\nimport CheckboxSubmit from './checkbox_submit'\n\nconst BookmarkToggle = (() => {\n // change form submit toggle to checkbox\n Blacklight.doBookmarkToggleBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-checkboxsubmit-target=\"checkbox\"]')) {\n const form = e.target.closest('form')\n if (form) new CheckboxSubmit(form).clicked(e);\n }\n });\n };\n Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';\n\n Blacklight.doBookmarkToggleBehavior();\n})()\n\nexport default BookmarkToggle\n","const ButtonFocus = (() => {\n document.addEventListener('click', (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-toggle=\"collapse\"]') || e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n })\n})()\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-bl-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bl-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport Blacklight from './core'\nimport ModalForm from './modalForm'\n\nconst Modal = (() => {\n // We keep all our data in Blacklight.modal object.\n // Create lazily if someone else created first.\n if (Blacklight.modal === undefined) {\n Blacklight.modal = {};\n }\n\n const modal = Blacklight.modal\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-bl-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n\n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)\n\n modal.show();\n };\n\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.closest('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n modal.setupModal()\n})()\n\nexport default Modal\n","import Blacklight from './core'\n\nconst SearchContext = (() => {\n Blacklight.doSearchContextBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-context-href]')) {\n Blacklight.handleSearchContextMethod.call(e.target, e)\n }\n })\n };\n\n Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\n Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n // this is the Rails.handleMethod with a couple adjustments, described inline:\n // first, we're attaching this directly to the event handler, so we can check for meta-keys\n Blacklight.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = Blacklight.csrfToken()\n let csrfParam = Blacklight.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n };\n\n Blacklight.doSearchContextBehavior();\n})()\n\nexport default SearchContext\n","import BookmarkToggle from './bookmark_toggle'\nimport ButtonFocus from './button_focus'\nimport Modal from './modal'\nimport SearchContext from './search_context'\nimport Core from './core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":"AAAA,MAAM,UAAU,GAAG,WAAW;AAC9B,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC;AAC3B,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,SAAS,IAAI,EAAE;AAC3B,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxB,KAAK;AACL;AACA,IAAI,QAAQ,EAAE,WAAW;AACzB,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACzB,OAAO;AACP,KAAK;AACL;AACA,IAAI,SAAS,EAAE,YAAY;AAC3B,MAAM,MAAM,SAAS,GAAG,EAAE,CAAC;AAC3B,MAAM,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;AACxC,QAAQ,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;AACzD,OAAO,MAAM,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,CAAC,SAAS,EAAE;AAC5E;AACA,QAAQ,IAAI,UAAU,CAAC,cAAc,EAAE;AACvC,UAAU,SAAS,CA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;AACnC,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AACjD;AACA,IAAI,KAAK,CAAC,cAAc,GAAE;AAC1B,GAAG,CAAC;AACJ;AACA,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;AACvC,CAAC;;AClDD,cAAe;AACf,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,KAAK;AACP,EAAE,aAAa;AACf,QAAEA,UAAI;AACN,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;AACrB;;;;"}
@@ -198,7 +198,7 @@
198
198
 
199
199
  <div data-blacklight-modal="container">
200
200
  <div class="modal-header">
201
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
201
+ <button type="button" class="close" data-bl-dismiss="modal" aria-hidden="true">×</button>
202
202
  <h3 class="modal-title">Request Placed</h3>
203
203
  </div>
204
204
 
@@ -209,7 +209,7 @@
209
209
 
210
210
 
211
211
  <div class="modal-footer">
212
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
212
+ <button type="button" class="btn btn-secondary" data-bl-dismiss="modal">Close</button>
213
213
  </div>
214
214
  </div>
215
215
 
@@ -253,7 +253,7 @@
253
253
 
254
254
  const contents = `<div class="modal-header">
255
255
  <div class="modal-title">There was a problem with your request.</div>
256
- <button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close">
256
+ <button type="button" class="blacklight-modal-close btn-close close" data-bl-dismiss="modal" aria-label="Close">
257
257
  <span aria-hidden="true" class="visually-hidden">&times;</span>
258
258
  </button>
259
259
  </div>
@@ -303,9 +303,9 @@
303
303
  // into one selector with a comma, so if something matches BOTH selectors, it
304
304
  // still only gets the event handler called once.
305
305
  document.addEventListener('click', (e) => {
306
- if (e.target.matches(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))
306
+ if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))
307
307
  modal.modalAjaxLinkClick(e);
308
- else if (e.target.matches('[data-bl-dismiss="modal"]'))
308
+ else if (e.target.closest('[data-bl-dismiss="modal"]'))
309
309
  modal.hide();
310
310
  });
311
311
  };
@@ -1 +1 @@
1
- {"version":3,"file":"blacklight.js","sources":["../../../javascript/blacklight/core.js","../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/index.js"],"sourcesContent":["const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n async clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n const response = await fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n })\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n if (response.ok) {\n const json = await response.json()\n this.updateStateFor(!this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n } else {\n alert('Error')\n }\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n updateStateFor(state) {\n this.checkboxTarget.checked = state\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import Blacklight from './core'\nimport CheckboxSubmit from './checkbox_submit'\n\nconst BookmarkToggle = (() => {\n // change form submit toggle to checkbox\n Blacklight.doBookmarkToggleBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-checkboxsubmit-target=\"checkbox\"]')) {\n const form = e.target.closest('form')\n if (form) new CheckboxSubmit(form).clicked(e);\n }\n });\n };\n Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';\n\n Blacklight.doBookmarkToggleBehavior();\n})()\n\nexport default BookmarkToggle\n","const ButtonFocus = (() => {\n document.addEventListener('click', (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-toggle=\"collapse\"]') || e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n })\n})()\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport Blacklight from './core'\nimport ModalForm from './modalForm'\n\nconst Modal = (() => {\n // We keep all our data in Blacklight.modal object.\n // Create lazily if someone else created first.\n if (Blacklight.modal === undefined) {\n Blacklight.modal = {};\n }\n\n const modal = Blacklight.modal\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-dismiss=\"modal\" data-bs-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n\n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)\n\n modal.show();\n };\n\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.matches(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.matches('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n modal.setupModal()\n})()\n\nexport default Modal\n","import Blacklight from './core'\n\nconst SearchContext = (() => {\n Blacklight.doSearchContextBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-context-href]')) {\n Blacklight.handleSearchContextMethod.call(e.target, e)\n }\n })\n };\n\n Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\n Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n // this is the Rails.handleMethod with a couple adjustments, described inline:\n // first, we're attaching this directly to the event handler, so we can check for meta-keys\n Blacklight.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = Blacklight.csrfToken()\n let csrfParam = Blacklight.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n };\n\n Blacklight.doSearchContextBehavior();\n})()\n\nexport default SearchContext\n","import BookmarkToggle from './bookmark_toggle'\nimport ButtonFocus from './button_focus'\nimport Modal from './modal'\nimport SearchContext from './search_context'\nimport Core from './core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":";;;;;;EAAA,MAAM,UAAU,GAAG,WAAW;EAC9B,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC;EAC3B,EAAE,OAAO;EACT,IAA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AI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,kBAAkB,EAAC;AACnF;EACA;EACA,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;EACvC,MAAM,MAAM,GAAG,QAAQ,CAAC;EACxB,KAAK;AACL;EACA,IAAI,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE;EAC5D,MAAM,WAAW,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,kBAAkB,EAAC;EACvF,KAAK;AACL;EACA;EACA;EACA,IAAI,WAAW,IAAI,0BAAyB;AAC5C;EACA,IAAI,IAAI,MAAM,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE;AACxD;EACA,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,OAAM;EAC/B,IAAI,IAAI,CAAC,SAAS,GAAG,YAAW;EAChC,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC;EACnC,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AACjD;EACA,IAAI,KAAK,CAAC,cAAc,GAAE;EAC1B,GAAG,CAAC;AACJ;EACA,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;EACvC,CAAC;;AClDD,gBAAe;EACf,EAAE,cAAc;EAChB,EAAE,WAAW;EACb,EAAE,KAAK;EACP,EAAE,aAAa;EACf,QAAEA,UAAI;EACN,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;EACrB;;;;;;;;"}
1
+ {"version":3,"file":"blacklight.js","sources":["../../../javascript/blacklight/core.js","../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/index.js"],"sourcesContent":["const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n async clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n const response = await fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n })\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n if (response.ok) {\n const json = await response.json()\n this.updateStateFor(!this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n } else {\n alert('Error')\n }\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n updateStateFor(state) {\n this.checkboxTarget.checked = state\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import Blacklight from './core'\nimport CheckboxSubmit from './checkbox_submit'\n\nconst BookmarkToggle = (() => {\n // change form submit toggle to checkbox\n Blacklight.doBookmarkToggleBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-checkboxsubmit-target=\"checkbox\"]')) {\n const form = e.target.closest('form')\n if (form) new CheckboxSubmit(form).clicked(e);\n }\n });\n };\n Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';\n\n Blacklight.doBookmarkToggleBehavior();\n})()\n\nexport default BookmarkToggle\n","const ButtonFocus = (() => {\n document.addEventListener('click', (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-toggle=\"collapse\"]') || e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n })\n})()\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-bl-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bl-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport Blacklight from './core'\nimport ModalForm from './modalForm'\n\nconst Modal = (() => {\n // We keep all our data in Blacklight.modal object.\n // Create lazily if someone else created first.\n if (Blacklight.modal === undefined) {\n Blacklight.modal = {};\n }\n\n const modal = Blacklight.modal\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-bl-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n\n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)\n\n modal.show();\n };\n\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.closest('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n modal.setupModal()\n})()\n\nexport default Modal\n","import Blacklight from './core'\n\nconst SearchContext = (() => {\n Blacklight.doSearchContextBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-context-href]')) {\n Blacklight.handleSearchContextMethod.call(e.target, e)\n }\n })\n };\n\n Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\n Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n // this is the Rails.handleMethod with a couple adjustments, described inline:\n // first, we're attaching this directly to the event handler, so we can check for meta-keys\n Blacklight.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = Blacklight.csrfToken()\n let csrfParam = Blacklight.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n };\n\n Blacklight.doSearchContextBehavior();\n})()\n\nexport default SearchContext\n","import BookmarkToggle from './bookmark_toggle'\nimport ButtonFocus from './button_focus'\nimport Modal from './modal'\nimport SearchContext from './search_context'\nimport Core from './core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":";;;;;;EAAA,MAAM,UAAU,GAAG,WAAW;EAC9B,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC;EAC3B,EAAE,OAAO;EACT,IAAI,MAAM,EAAE,SAAS,IAAI,EAAE;EAC3B,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACxB,KAAK;AACL;EACA,IAAI,QAAQ,EAAE,WAAW;EACzB,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;EAC7C,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;EACzB,OAAO;EACP,KAAK;AACL;EACA,IAAI,SAAS,EAAE,YAAY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AACL;EACA;EACA;EACA,IAAI,WAAW,IAAI,0BAAyB;AAC5C;EACA,IAAI,IAAI,MAAM,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE;AACxD;EACA,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,OAAM;EAC/B,IAAI,IAAI,CAAC,SAAS,GAAG,YAAW;EAChC,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC;EACnC,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AACjD;EACA,IAAI,KAAK,CAAC,cAAc,GAAE;EAC1B,GAAG,CAAC;AACJ;EACA,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;EACvC,CAAC;;AClDD,gBAAe;EACf,EAAE,cAAc;EAChB,EAAE,WAAW;EACb,EAAE,KAAK;EACP,EAAE,aAAa;EACf,QAAEA,UAAI;EACN,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;EACrB;;;;;;;;"}
@@ -1,7 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'view_component/version'
4
+
3
5
  module Blacklight
4
6
  class DocumentComponent < Blacklight::Component
7
+ # ViewComponent 3 changes iteration counters to begin at 0 rather than 1
8
+ COLLECTION_INDEX_OFFSET = ViewComponent::VERSION::MAJOR < 3 ? 0 : 1
9
+
5
10
  # Content appearing before the document
6
11
  renders_one :header
7
12
 
@@ -56,38 +61,33 @@ module Blacklight
56
61
  # Backwards compatibility
57
62
  renders_one :actions
58
63
 
59
- with_collection_parameter :document
60
-
61
64
  # rubocop:disable Metrics/ParameterLists
62
- # @param document [Blacklight::Document]
63
- # @param presenter [Blacklight::DocumentPresenter]
65
+ # @param document [Blacklight::DocumentPresenter]
66
+ # @param partials [Array, nil] view partial names that should be used to provide content for the `partials` slot
64
67
  # @param id [String] HTML id for the root element
65
68
  # @param classes [Array, String] additional HTML classes for the root element
66
69
  # @param component [Symbol, String] HTML tag type to use for the root element
67
70
  # @param title_component [Symbol, String] HTML tag type to use for the title element
68
71
  # @param counter [Number, nil] a pre-computed counter for the position of this document in a search result set
69
- # @param document_counter [Number, nil] alternatively, the document's position in a collection and,
70
- # @param counter_offset [Number] with `document_counter`, the offset of the start of that collection counter to the overall result set
72
+ # @param document_counter [Number, nil] provided by ViewComponent collection iteration
73
+ # @param counter_offset [Number] the offset of the start of the collection counter parameter for the component to the overall result set
71
74
  # @param show [Boolean] are we showing only a single document (vs a list of search results); used for backwards-compatibility
72
- def initialize(document: nil, presenter: nil,
75
+ def initialize(document: nil, partials: nil,
73
76
  id: nil, classes: [], component: :article, title_component: nil,
74
77
  counter: nil, document_counter: nil, counter_offset: 0,
75
- show: false)
76
- if presenter.nil? && document.nil?
77
- raise ArgumentError, 'missing keyword: :document or :presenter'
78
- end
79
-
80
- @document = document || presenter&.document
81
- @presenter = presenter
78
+ show: false, **args)
79
+ @presenter = document || args[self.class.collection_parameter]
80
+ @document = @presenter.document
81
+ @view_partials = partials || []
82
82
 
83
83
  @component = component
84
84
  @title_component = title_component
85
85
  @id = id || ('document' if show)
86
86
  @classes = classes
87
87
 
88
- @document_counter = document_counter
89
88
  @counter = counter
90
- @counter ||= document_counter + 1 + counter_offset if document_counter.present?
89
+ @document_counter = document_counter || args.fetch(self.class.collection_counter_parameter, nil)
90
+ @counter ||= @document_counter + COLLECTION_INDEX_OFFSET + counter_offset if @document_counter.present?
91
91
 
92
92
  @show = show
93
93
  end
@@ -108,13 +108,20 @@ module Blacklight
108
108
  set_slot(:thumbnail, nil) unless thumbnail || show?
109
109
  set_slot(:metadata, nil, fields: presenter.field_presenters) unless metadata
110
110
  set_slot(:embed, nil) unless embed
111
+ if view_partials.present?
112
+ view_partials.each do |view_partial|
113
+ with_partial(view_partial) do
114
+ helpers.render_document_partial @document, view_partial, component: self, document_counter: @counter
115
+ end
116
+ end
117
+ else
118
+ set_slot(:partials, nil)
119
+ end
111
120
  end
112
121
 
113
122
  private
114
123
 
115
- def presenter
116
- @presenter ||= helpers.document_presenter(@document)
117
- end
124
+ attr_reader :document_counter, :presenter, :view_partials
118
125
 
119
126
  def show?
120
127
  @show
@@ -1,5 +1,7 @@
1
- <dl class="document-metadata dl-invert row">
1
+ <% content = capture do %>
2
2
  <% fields.each do |field| -%>
3
3
  <%= field %>
4
4
  <% end -%>
5
- </dl>
5
+ <% end %>
6
+
7
+ <%= @tag.nil? ? content : tag.public_send(@tag, content, class: @classes, **@component_args) %>
@@ -8,17 +8,23 @@ module Blacklight
8
8
  with_collection_parameter :fields
9
9
 
10
10
  # @param fields [Enumerable<Blacklight::FieldPresenter>] Document field presenters
11
- def initialize(fields: [], show: false, view_type: nil)
11
+ # rubocop:disable Metrics/ParameterLists
12
+ def initialize(fields: [], tag: 'dl', classes: %w[document-metadata dl-invert row], show: false, view_type: nil, field_layout: nil, **component_args)
12
13
  @fields = fields
14
+ @tag = tag
15
+ @classes = classes
13
16
  @show = show
14
17
  @view_type = view_type
18
+ @field_layout = field_layout
19
+ @component_args = component_args
15
20
  end
21
+ # rubocop:enable Metrics/ParameterLists
16
22
 
17
23
  def before_render
18
24
  return unless fields
19
25
 
20
26
  @fields.each do |field|
21
- with_field(component: field.component, field: field, show: @show, view_type: @view_type)
27
+ with_field(component: field.component, field: field, show: @show, view_type: @view_type, layout: @field_layout)
22
28
  end
23
29
  end
24
30
 
@@ -5,18 +5,21 @@ module Blacklight
5
5
  with_collection_parameter :field
6
6
  renders_one :label
7
7
  renders_many :values, (lambda do |value: nil, &block|
8
- if block
9
- content_tag :dd, class: "#{@value_class} blacklight-#{@key}", &block
8
+ if @value_tag.nil?
9
+ block&.call || value
10
+ elsif block
11
+ content_tag @value_tag, class: "#{@value_class} blacklight-#{@key}", &block
10
12
  else
11
- content_tag :dd, value, class: "#{@value_class} blacklight-#{@key}"
13
+ content_tag @value_tag, value, class: "#{@value_class} blacklight-#{@key}"
12
14
  end
13
15
  end)
14
16
 
15
17
  # @param field [Blacklight::FieldPresenter]
16
- def initialize(field:, label_class: 'col-md-3', value_class: 'col-md-9')
18
+ def initialize(field:, value_tag: 'dd', label_class: 'col-md-3', value_class: 'col-md-9')
17
19
  @field = field
18
20
  @key = @field.key.parameterize
19
21
  @label_class = label_class
22
+ @value_tag = value_tag
20
23
  @value_class = value_class
21
24
  end
22
25
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Blacklight
4
+ class MetadataFieldPlainTextLayoutComponent < Blacklight::MetadataFieldLayoutComponent
5
+ with_collection_parameter :field
6
+
7
+ def initialize(field:, **kwargs)
8
+ super(field: field, **kwargs, value_tag: nil)
9
+ end
10
+
11
+ # rubocop:disable Rails/OutputSafety
12
+ def call
13
+ [label.to_s.strip, helpers.strip_tags(CGI.unescape_html(safe_join(values, "\n")).strip)].compact.join(' ').html_safe
14
+ end
15
+ # rubocop:enable Rails/OutputSafety
16
+ end
17
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Blacklight
4
4
  module Response
5
- class SortComponent < ViewComponent::Base
5
+ class SortComponent < Blacklight::Component
6
6
  def initialize(search_state:, param: 'sort', choices: {}, id: 'sort-dropdown', classes: [], selected: nil)
7
7
  @param = param
8
8
  @choices = choices
@@ -3,7 +3,7 @@
3
3
  module Blacklight
4
4
  module Response
5
5
  # Render spellcheck results for a search query
6
- class SpellcheckComponent < ViewComponent::Base
6
+ class SpellcheckComponent < Blacklight::Component
7
7
  # @param [Blacklight::Response] response
8
8
  # @param [Array<String>] options explicit spellcheck options to render
9
9
  def initialize(response:, options: nil)
@@ -3,7 +3,7 @@
3
3
  module Blacklight
4
4
  module Response
5
5
  # Render spellcheck results for a search query
6
- class ViewTypeButtonComponent < ViewComponent::Base
6
+ class ViewTypeButtonComponent < Blacklight::Component
7
7
  with_collection_parameter :view
8
8
  # @param [Blacklight::Configuration::View] view
9
9
  def initialize(view:, key: nil, selected: false, search_state: nil, classes: 'btn btn-outline-secondary btn-icon')
@@ -3,7 +3,7 @@
3
3
  module Blacklight
4
4
  module Response
5
5
  # Render spellcheck results for a search query
6
- class ViewTypeComponent < ViewComponent::Base
6
+ class ViewTypeComponent < Blacklight::Component
7
7
  renders_many :views, 'Blacklight::Response::ViewTypeButtonComponent'
8
8
 
9
9
  # @param [Blacklight::Response] response
@@ -0,0 +1,4 @@
1
+ <div id="appliedParams" class="clearfix constraints-container">
2
+ <%= render 'start_over' %>
3
+ <%= link_back_to_catalog class: 'btn btn-outline-secondary' %>
4
+ </div>
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Blacklight
4
+ module SearchContext
5
+ class ServerAppliedParamsComponent < Blacklight::Component
6
+ delegate :current_search_session, :link_back_to_catalog, to: :helpers
7
+
8
+ def render?
9
+ current_search_session
10
+ end
11
+ end
12
+ end
13
+ end