Skip to content

Commit

Permalink
Merge pull request #3128 from projectblacklight/blacklight_frontend_i…
Browse files Browse the repository at this point in the history
…ndividual_sources

Fix allowing imports of individual source files/modules from blacklight-frontend npm package
  • Loading branch information
jrochkind committed Jan 22, 2024
2 parents 7ff508d + d8c0ec4 commit 2052685
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/javascript/blacklight/bookmark_toggle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CheckboxSubmit from 'blacklight/checkbox_submit'
import CheckboxSubmit from './checkbox_submit.js'

const BookmarkToggle = (e) => {
if (e.target.matches('[data-checkboxsubmit-target="checkbox"]')) {
Expand Down
15 changes: 10 additions & 5 deletions app/javascript/blacklight/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import BookmarkToggle from 'blacklight/bookmark_toggle'
import ButtonFocus from 'blacklight/button_focus'
import Modal from 'blacklight/modal'
import SearchContext from 'blacklight/search_context'
import Core from 'blacklight/core'
// ALL imports in this dir, including in files imported, should be RELATIVE
// paths to keep things working in the various ways these files get used, at
// both compile time and npm package run time.

import BookmarkToggle from './bookmark_toggle.js'
import ButtonFocus from './button_focus.js'
import Modal from './modal.js'
import SearchContext from './search_context.js'
import Core from './core.js'


export default {
BookmarkToggle,
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/blacklight/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
can be a turbo-stream that defines some HTML fragementsand where on the page to put them:
https://turbo.hotwired.dev/handbook/streams
*/
import ModalForm from 'blacklight/modalForm'
import ModalForm from './modalForm.js'

const Modal = (() => {
const modal = {}
Expand Down

0 comments on commit 2052685

Please sign in to comment.